<template>
  <div>
    <h1>Welcome to GlobalLove Management System!</h1>
    <h2>用户名称：{{username}}</h2>
    <h2>用户类型：{{userType}}</h2>
    <h2>登录时间：{{logTime}}</h2>
  </div>
</template>
<script>
  export default{
    name: 'welcome',
    data(){
      return {
        SUPER:'0',
        MANAGER:'1',
        EXPERT:'2',
        username:'',
        logTime:'',
        type:'',
      }
    },
    methods: {

    },
    computed:{
      userType(){
        switch(this.type)
        {
          case this.SUPER:return '超级管理员';break;
          case this.MANAGER:return '管理员';break;
          case this.EXPERT:return '情感专家';break;
          default:return '未知';break;
        }
      }
    },
    created(){
      this.username = sessionStorage.getItem('username');
      this.logTime = sessionStorage.getItem('logTime');
      this.type = sessionStorage.getItem('type');
    }
  }
</script>
<style scoped>
  h1{
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 5em;
  }
  h2{
    margin: 1em 15em;
    font-size: 1em;
  }
</style>